package com.winning.pmph.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import javax.persistence.Table;
import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * @author 刘亚飞
 * @date 2021-07-15
 */

@Table(name = "journal")
@Data
public class Journal extends BaseEntity {

    private static final long serialVersionUID = -7181217156612147754L;

    /**
     * 正在导入中
     */
    public static final int STATUS_IMPORTING = 0;

    /**
     * 导入失败
     */
    public static final int STATUS_IMPORT_FAILURE = 1;

    /**
     * 导入成功
     */
    public static final int STATUS_IMPORT_SUCCESS = 2;

    /**
     * 草稿库
     */
    public static final int TYPE_DRAFT = 0;

    /**
     * 正式库
     */
    public static final int TYPE_OFFICIAL = 1;

    /**
     * 同步状态, 0: 未同步, 1:已同步, 2: 同步失败
     */
    public static final int SYNC_STATUS_WAITING = 0;
    public static final int SYNC_STATUS_SUCCESS = 1;
    public static final int SYNC_STATUS_FAILED_PRODUCER = 2;
    public static final int SYNC_STATUS_FAILED_CONSUMER = 3;

    /**
     * id
     */
    @TableId
    private String id;

    /**
     * 期刊名称
     */
    private String name;

    /**
     * 期刊分类
     */
    private String category;

    /**
     * 期刊目录
     */
    private String catalog;

    /**
     * issn
     */
    private String issn;

    /**
     * 卷
     */
    private String volume;

    /**
     * 期
     */
    private String issue;

    /**
     * cn
     */
    private String cn;

    /**
     * 0 导入中  1 导入失败  2导入成功
     */
    private Integer status;

    /**
     * 0 草稿库 1 正式库
     */
    private Integer type;
    /**
     * 0 草稿库 1 正式库
     */
    private Integer version;
    /**
     * 导入失败原因
     */
    private String failureReason;

    /**
     * 发布时间
     */
    private String releaseTime;

    /**
     * 期刊元数据
     */
    private String metadata;

    /**
     * 文件存储路径
     */
    //若没有开启驼峰命名，或者表中列名不符合驼峰规则，可通过该注解指定数据库表中的列名，exist标明数据表中有没有对应列
    @TableField(exist = false)
    private String filePath;
    /**
     * 解压路径,方便删除
     */
    @TableField(exist = false)
    private String unZipPath;
    @TableField(exist = false)
    private List<File> articleFile;
    /**
     * images文件夹下的图片名称集合
     */
    @TableField(exist = false)
    private List<String> imageList;
    @TableField(exist = false)
    private String imgPath;
    @TableField(exist = false)
    private String importDate;
    @TableField(exist = false)
    private String importStartDate;
    @TableField(exist = false)
    private String importEndDate;
    @TableField(exist = false)
    private String releaseStartDate;
    @TableField(exist = false)
    private String releaseEndDate;
    @TableField(exist = false)
    private String importUser;
    @TableField(exist = false)
    private String selectedPlatform;
    @TableField(exist = false)
    private String coverImg;
    /**
     * 状态标记, 0:推送mq失败, 1:mq消费失败, 2:待同步, 3: 同步成功
     * 与knowledge_sync_status表的状态保持一致
     */
    @TableField(exist = false)
    private Integer syncStatus;

    /**
     * 关键字
     */
    @TableField(exist = false)
    private String kwdGroup;

    /**
     * 摘要
     */
    @TableField(exist = false)
    private String abstractStr;

    @TableField(exist = false)
    private Map<String, UncommonWord> uncommonWordMap;

    @TableField(exist = false)
    private List<String> journalPermissionList; // 当前用户权限限制(查询条件使用);

    /**
     * 期刊出版年份
     */
    private String publishYear;

    @TableField(exist = false)
    private String operatedTime;
}